package WinterVacation.Day6;

public class Num2 {
    public static int findNumberAppearOnce(int []arr){
        if(arr.length == 1){
            return arr[0];
        }
        int num = 0;
        for (int i = 0; i < arr.length; i++) {
            num = arr[i] ^ num;
        }
        return num;
    }

    public static void main(String[] args) {
        int []arr = {1,2,3,3,2,1,5};
        System.out.println(findNumberAppearOnce(arr));
    }
}
